import Vue from 'vue';
import VueRouter from 'vue-router';
Vue.use(VueRouter);

const routes=[
    {path:"", redirect:"/home"},
    {path:"/home", component:()=>import('@/views/home/index'),
        name:"home",meta:{tree:1}
    },
    {path:"/category", component:()=>import('@/views/category/index'),
        name:"category",meta:{tree:1}
        },
    {path:"/message", component:()=>import('@/views/message/index'),
        name:"message",meta:{tree:1}
        },
    {path:"/cart", component:()=>import('@/views/cart/index'),
        name:"cart",meta:{tree:1}
        },
    {path:"/profile", component:()=>import('@/views/profile/index'),
        name:"profile",meta:{tree:1}
        },


    {path:"/goodsDetail", component:()=>import('@/views/goodsDetail/index'),
        name:"goodsDetail",meta:{tree:2}},
    {path:"/messageDetail", component:()=>import('@/views/message/messageDetail/index'),
        name:"messageDetail",meta:{tree:2}},


];

const router=new VueRouter({
    // mode:'history',
    routes
});

export default router